package com.nervenets.general.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.nervenets.general.annotation.FormDefinition;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;

import java.util.List;

/**
 * Created by joe on 17-4-5.
 */
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class FormField extends FormBaseField {
    @ApiModelProperty(value = "描述")
    private String desc;
    @ApiModelProperty(value = "是否必填")
    private boolean required;
    @ApiModelProperty(value = "字段类型")
    private FormDefinition.InputType inputType;
    @ApiModelProperty(value = "分组")
    private String group;
    @ApiModelProperty(value = "默认值")
    private String def;
    @ApiModelProperty(value = "最大长度，0不限")
    private int maxLength;
    @ApiModelProperty(value = "选择组件的选项")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Selection> selections;
    @ApiModelProperty(value = "对象字段的字段")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<FormField> children;
}
